﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace DataAccess
{
   public class MaHoaMatKhau
   {
       public static string GetMD5(string chuoi)
       {
           string str_md5 = "";
           byte[] mang = System.Text.Encoding.UTF8.GetBytes(chuoi);

           MD5CryptoServiceProvider my_md5 = new MD5CryptoServiceProvider();
           mang = my_md5.ComputeHash(mang);

           foreach (byte b in mang)
           {
               str_md5 += b.ToString("X2");
           }

           return str_md5;
       }
   }
}
